.class public Lrexsee/natives/clazz/ViewOnTouchListener;
.super Ljava/lang/Object;
.source "ViewOnTouchListener.java"

# interfaces
.implements Landroid/view/View$OnTouchListener;


# instance fields
.field private final mBrowser:Lrexsee/core/browser/Browser;

.field private final mGestureDetector:Landroid/view/GestureDetector;

.field private final mId:Ljava/lang/String;

.field private final mMultiTouchListener:Lrexsee/dialog/ImageMultiTouchListener;

.field private final mTouchMove:Z


# direct methods
.method public constructor <init>(Lrexsee/core/browser/Browser;Ljava/lang/String;ZLrexsee/dialog/ImageMultiTouchListener;)V
    .locals 3
    .param p1, "browser"    # Lrexsee/core/browser/Browser;
    .param p2, "id"    # Ljava/lang/String;
    .param p3, "touchMove"    # Z
    .param p4, "imageMultiTouchListener"    # Lrexsee/dialog/ImageMultiTouchListener;

    .prologue
    .line 19
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 20
    iput-object p1, p0, Lrexsee/natives/clazz/ViewOnTouchListener;->mBrowser:Lrexsee/core/browser/Browser;

    .line 21
    iput-boolean p3, p0, Lrexsee/natives/clazz/ViewOnTouchListener;->mTouchMove:Z

    .line 22
    iput-object p2, p0, Lrexsee/natives/clazz/ViewOnTouchListener;->mId:Ljava/lang/String;

    .line 23
    new-instance v0, Landroid/view/GestureDetector;

    new-instance v1, Lrexsee/natives/clazz/ViewGestureListener;

    iget-object v2, p0, Lrexsee/natives/clazz/ViewOnTouchListener;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-direct {v1, v2, p2}, Lrexsee/natives/clazz/ViewGestureListener;-><init>(Lrexsee/core/browser/Browser;Ljava/lang/String;)V

    invoke-direct {v0, v1}, Landroid/view/GestureDetector;-><init>(Landroid/view/GestureDetector$OnGestureListener;)V

    iput-object v0, p0, Lrexsee/natives/clazz/ViewOnTouchListener;->mGestureDetector:Landroid/view/GestureDetector;

    .line 24
    iput-object p4, p0, Lrexsee/natives/clazz/ViewOnTouchListener;->mMultiTouchListener:Lrexsee/dialog/ImageMultiTouchListener;

    .line 25
    return-void
.end method


# virtual methods
.method public onTouch(Landroid/view/View;Landroid/view/MotionEvent;)Z
    .locals 7
    .param p1, "v"    # Landroid/view/View;
    .param p2, "event"    # Landroid/view/MotionEvent;

    .prologue
    const/4 v6, 0x3

    const/4 v5, 0x2

    const/4 v4, 0x1

    .line 29
    invoke-virtual {p2}, Landroid/view/MotionEvent;->getAction()I

    move-result v0

    .line 30
    .local v0, "action":I
    new-array v1, v6, [Ljava/lang/String;

    const/4 v2, 0x0

    iget-object v3, p0, Lrexsee/natives/clazz/ViewOnTouchListener;->mId:Ljava/lang/String;

    aput-object v3, v1, v2

    invoke-virtual {p2}, Landroid/view/MotionEvent;->getX()F

    move-result v2

    invoke-static {v2}, Ljava/lang/String;->valueOf(F)Ljava/lang/String;

    move-result-object v2

    aput-object v2, v1, v4

    invoke-virtual {p2}, Landroid/view/MotionEvent;->getY()F

    move-result v2

    invoke-static {v2}, Ljava/lang/String;->valueOf(F)Ljava/lang/String;

    move-result-object v2

    aput-object v2, v1, v5

    .line 31
    .local v1, "argu":[Ljava/lang/String;
    if-nez v0, :cond_2

    .line 32
    iget-object v2, p0, Lrexsee/natives/clazz/ViewOnTouchListener;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v2, v2, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v3, "onJavaViewTouchDown"

    invoke-virtual {v2, v3, v1}, Lrexsee/core/browser/clazz/EventList;->run(Ljava/lang/String;[Ljava/lang/String;)V

    .line 40
    :cond_0
    :goto_0
    iget-object v2, p0, Lrexsee/natives/clazz/ViewOnTouchListener;->mMultiTouchListener:Lrexsee/dialog/ImageMultiTouchListener;

    if-eqz v2, :cond_1

    iget-object v2, p0, Lrexsee/natives/clazz/ViewOnTouchListener;->mMultiTouchListener:Lrexsee/dialog/ImageMultiTouchListener;

    invoke-virtual {v2, p1, p2}, Lrexsee/dialog/ImageMultiTouchListener;->onTouch(Landroid/view/View;Landroid/view/MotionEvent;)Z

    .line 41
    :cond_1
    iget-object v2, p0, Lrexsee/natives/clazz/ViewOnTouchListener;->mGestureDetector:Landroid/view/GestureDetector;

    invoke-virtual {v2, p2}, Landroid/view/GestureDetector;->onTouchEvent(Landroid/view/MotionEvent;)Z

    move-result v2

    return v2

    .line 33
    :cond_2
    if-ne v0, v4, :cond_3

    .line 34
    iget-object v2, p0, Lrexsee/natives/clazz/ViewOnTouchListener;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v2, v2, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v3, "onJavaViewTouchUp"

    invoke-virtual {v2, v3, v1}, Lrexsee/core/browser/clazz/EventList;->run(Ljava/lang/String;[Ljava/lang/String;)V

    goto :goto_0

    .line 35
    :cond_3
    if-ne v0, v5, :cond_4

    iget-boolean v2, p0, Lrexsee/natives/clazz/ViewOnTouchListener;->mTouchMove:Z

    if-eqz v2, :cond_4

    .line 36
    iget-object v2, p0, Lrexsee/natives/clazz/ViewOnTouchListener;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v2, v2, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v3, "onJavaViewTouchMove"

    invoke-virtual {v2, v3, v1}, Lrexsee/core/browser/clazz/EventList;->run(Ljava/lang/String;[Ljava/lang/String;)V

    goto :goto_0

    .line 37
    :cond_4
    if-ne v0, v6, :cond_0

    .line 38
    iget-object v2, p0, Lrexsee/natives/clazz/ViewOnTouchListener;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v2, v2, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v3, "onJavaViewTouchCancel"

    invoke-virtual {v2, v3, v1}, Lrexsee/core/browser/clazz/EventList;->run(Ljava/lang/String;[Ljava/lang/String;)V

    goto :goto_0
.end method
